#
#	Makefile for oficonv/tests
#

@SET_MAKE@

SHELL = /bin/sh
VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include
srcdir = @srcdir@
top_srcdir = @top_srcdir@
configdir = @top_srcdir@/@configdir@

include $(configdir)/@common_makefile@

ofstddir = $(top_srcdir)/../ofstd

LOCALINCLUDES = -I$(top_srcdir)/include -I$(ofstddir)/include -I$(configdir)/include
LIBDIRS = -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc
LOCALLIBS = -loficonv -lofstd $(CHARCONVLIBS) $(MATHLIBS)

objs = tests.o oficonv_tests.o ticonv.o ticonv_iso8859.o ticonv_chinese.o \
       ticonv_japanese.o ticonv_korean.o
progs = tests


# in order to avoid a cyclic dependency between ofstd and oficonv, we only compile
# the binaries for the unit test here, but perform the linking step in ofstd/tests
# when both libofstd.a and liboficonv.a are available

all: $(objs)

tests: $(objs)
	$(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) -o $@ $(objs) $(I2DLIBS) $(LOCALLIBS) $(LIBS)


check: tests
	DCMICONVPATH=../data ./tests

check-exhaustive: tests
	DCMICONVPATH=../data ./tests -x


install: all


clean:
	rm -f $(objs) $(progs) $(TRASH)

distclean:
	rm -f $(objs) $(progs) $(DISTTRASH)


dependencies:
	$(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc  > $(DEP)

include $(DEP)
